import { fetchUserWxLogin } from '~/request/api';
// utils
import { wxPromisify } from '~/utils/util';
const wxLogin = wxPromisify(wx.login);

export default async () => {
  // 登录
  const res = await wxLogin();
  console.log('登录的code::', res.code);
  const data = await fetchUserWxLogin({ code: res.code });
  return data.token;
};
